package com.xxjz.sc.controller.area;

import com.xxjz.sc.bean.common.Area;
import com.xxjz.sc.mapper.area.AreaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class AreaController {

    @Autowired
    AreaMapper areaMapper;

    @GetMapping("/area/{id}")
    public Area getAreaById(@PathVariable("id") Integer id){
        return areaMapper.getAreaById(id);
    }

    @GetMapping("/areaByPid/{parent_id}")
    public Area getAreaByPid(@PathVariable("parent_id") Integer parent_id){
        return areaMapper.getAreaByPid(parent_id);
    }
}
